package com.altekis.kanbankaze.client;

import java.util.Date;
import java.util.List;

import com.altekis.kanbankaze.shared.SerializableWhiteList;
import com.altekis.kanbankaze.shared.Task;
import com.altekis.kanbankaze.shared.UserStory;
import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * The async counterpart of {@link TaskService}.
 * 
 * @author gabriprat
 * 
 */
public interface TaskServiceAsync {
	/**
	 * Saves the given task
	 * @param task The task to save
	 * @param callback
	 * @see TaskService#save(Task)
	 */
	void save(Task task, AsyncCallback<Task> callback);
	
	/**
	 * Gets all the Tasks
	 *  @param callback
	 *  @see TaskService#findAll()
	 */
	void findAll(AsyncCallback<List<Task>> callback);
	
	/**
	 * Gets all the User Stories
	 *  @param callback
	 *  @see TaskService#findAllUserStories()
	 */
	void findAllUserStories(AsyncCallback<List<UserStory>> callback);

	/**
	 * Gets all the Tasks with {@link Task#getModificationDate()} greater than
	 * the given date.
	 * 
	 * @param minDate
	 *            The minimum modification date
	 * @param callback
	 * @see TaskService#findNewer(Date)
	 */
	void findNewer(Date minDate, AsyncCallback<List<Task>> callback);
	
	/** Fake method to force classes' serialization */
	void fakeMethod(SerializableWhiteList l,
			AsyncCallback<SerializableWhiteList> callback);
}
